<?php

use think\facade\Route;

//【通用】验证码图片
Route::get('app_store/common/captcha', 'store.Common/getCaptcha');
Route::get('app_store/login/getCode', 'store.Common/getCode');
//【账号】登录
Route::post('app_store/account/login', 'store.AuthUser/onLogin');

Route::group('app_store/', function () {
    //【账号】退出登录
    Route::post('account/logout', 'AuthUser/onLogout');
    //【账号】修改密码
    Route::post('account/editpwd', 'AuthUser/onEditpwd');
    //【账号】刷新token
    Route::post('account/token', 'AuthUser/onToken');
    //【账号】用户信息
    Route::get('account/profile', 'AuthUser/getProfile');
    //【缓存】重新生成
    Route::post('caches/reset', 'Caches/onReset');

    //【工作台】
    Route::get('dashboard/statistics', 'Dashboard/getStatistics');

    //【统计分析-用户分析】
    Route::get('analysis/user/realtime', 'Analysis/getUserRealtime');
    Route::get('analysis/user/history', 'Analysis/getUserHistory');
    Route::get('analysis/user/compare', 'Analysis/getUserCompare');
    Route::get('analysis/user/share', 'Analysis/getUserShare');
    Route::get('analysis/user/area', 'Analysis/getUserArea');
    Route::get('analysis/user/terminal', 'Analysis/getUserTerminal');
    Route::get('analysis/user/network', 'Analysis/getUserNetwork');
    Route::get('analysis/user/period', 'Analysis/getUserPeriod');
    Route::get('analysis/user/machine', 'Analysis/getUserMachine');
    //销售分析
    Route::get('analysis/user/sale', 'Analysis/getUserSale');
    //商品统计
    Route::get('analysis/user/goods', 'Analysis/getUserGoods');
    // 商品经营数据
    Route::get('analysis/user/order', 'Analysis/getUserOrder');

    //【Banner】
    Route::get('banner/page', 'StoreBanner/getPage');
    Route::get('banner/info', 'StoreBanner/getInfo');
    Route::post('banner/save', 'StoreBanner/onSave');
    Route::post('banner/delete', 'StoreBanner/onDelete');
    Route::post('banner/status', 'StoreBanner/onStatus');

    //【商品管理】
    Route::get('goods/page', 'Goods/getPage');
    Route::get('goods/info', 'Goods/getInfo');
    Route::post('goods/status', 'Goods/onStatus');
    Route::post('goods/pt_status', 'Goods/onPtStatus');
    Route::post('goods/hot_status', 'Goods/onHotStatus');
    Route::post('goods/save', 'Goods/onSave');
    Route::post('goods/delete', 'Goods/onDelete');
    Route::get('goods/load_list', 'Goods/onLoadList');
    Route::post('goods/add_attribute', 'Goods/onAddAttribute');
    Route::post('goods/del_attribute', 'Goods/onDelAttribute');


    //【商品库存管理】
    Route::get('goods/store/page', 'GoodsStore/getPage');
    Route::get('goods/store/list', 'GoodsStore/listPage');
    Route::get('goods/store/info', 'GoodsStore/getInfo');
    Route::post('goods/store/status', 'GoodsStore/onStatus');
    Route::post('goods/store/save', 'GoodsStore/onSave');
    Route::post('goods/store/delete', 'GoodsStore/onDelete');

    //【运费模板管理】
    Route::get('freight/page', 'GoodsFreight/getPage');
    Route::get('freight/info', 'GoodsFreight/getInfo');
    Route::post('freight/save', 'GoodsFreight/onSave');
    Route::post('freight/delete', 'GoodsFreight/onDelete');
    Route::post('freight/default', 'GoodsFreight/onDefault');

    //【商家图文动态】
    Route::get('store/article/page', 'StoreArticle/getPage');
    Route::get('store/article/info', 'StoreArticle/getInfo');
    Route::post('store/article/save', 'StoreArticle/onSave');
    Route::post('store/article/status', 'StoreArticle/onStatus');
    Route::post('store/article/hot', 'StoreArticle/onHot');
    Route::post('store/article/delete', 'StoreArticle/onDelete');

    //【店铺基本信息】
    Route::get('store/basic/info', 'StoreBasic/getInfo');
    Route::post('store/basic/save', 'StoreBasic/onSave');

    //【活动(团购)管理】
    Route::get('activity/page', 'Activity/getPage');
    Route::get('activity/info', 'Activity/getInfo');
    Route::post('activity/status', 'Activity/onStatus');
    Route::post('activity/save', 'Activity/onSave');
    Route::post('activity/delete', 'Activity/onDelete');

    //【活动(团购)管理】
    Route::get('activityGoods/page', 'ActivityGoods/getPage');
    Route::get('activityGoods/info', 'ActivityGoods/getInfo');
    Route::post('activityGoods/change', 'activityGoods/onChange');
    Route::post('activityGoods/status', 'ActivityGoods/onStatus');
    Route::post('activityGoods/save', 'ActivityGoods/onSave');
    Route::post('activityGoods/delete', 'ActivityGoods/onDelete');


    //【经销商(渠道商)管理】
    Route::get('distributor/page', 'Distributor/getPage');
    Route::get('distributor/all', 'Distributor/getAll');
    Route::get('distributor/info', 'Distributor/getInfo');
    Route::post('distributor/status', 'Distributor/onStatus');
    Route::post('distributor/save', 'Distributor/onSave');
    Route::post('distributor/delete', 'Distributor/onDelete');

    //【订单管理】
    Route::get('order/page', 'Order/getPage');
    Route::get('paylog/page', 'Order/getPayPage');
    Route::get('order/info', 'Order/getInfo');
    Route::post('order/delete', 'Order/onDelete');

    Route::get('order/logisticsInfo', 'Order/getInfo');
    Route::get('order/logisticsLog', 'Order/getLogisticsLog');
    Route::post('order/saveLogistics', 'Order/onSaveLogistics');
    Route::get('order/logisticsAll', 'Order/onLogisticsAll');
    Route::post('order/getItemsInfo', 'Order/getItemsInfo');

    Route::get('order/orderOutPage', 'Order/onOutPage');
    Route::post('order/orderOutInfo', 'Order/onOutInfo');
    Route::post('order/orderOutEdit', 'Order/onOrderOutEdit');
    Route::post('order/orderOutSave', 'Order/onOrderOutSave');
    Route::get('order/confirmTake', 'Order/onConfirmTake');
    Route::get('order/cancelOrder', 'Order/onCancelOrder');
    Route::post('order/setOrderPrice', 'Order/onSetOrderPrice');
    Route::post('order/setTakeAddress', 'Order/onSetTakeAddress');
    Route::post('order/setLogisticsNumber', 'Order/onSetLogisticsNumber');
    Route::get('order/payOrder', 'Order/onPayOrder');
    //修改实际收款确收款
    Route::post('order/setPayOrder', 'Order/onSetPayOrder');
    Route::get('order/exportOrderGoods', 'Order/onExportOrderGoods');
    Route::post('order/orderOutDelete', 'Order/onDelete');
    Route::post('order/exportOrderGoods', 'Order/onExportOrderGoods');

    //【物流管理】
    Route::get('logistics/page', 'Logistics/getPage');
    Route::get('logistics/info', 'Logistics/getInfo');
    Route::post('logistics/save', 'Logistics/onSave');
    Route::post('logistics/delete', 'Logistics/onDelete');


    //【权限-菜单规则】
    Route::get('auth/rule/tree', 'AuthRule/getTree');
    Route::get('auth/rule/info', 'AuthRule/getInfo');
    Route::post('auth/rule/save', 'AuthRule/onSave');
    Route::post('auth/rule/delete', 'AuthRule/onDelete');

    //【权限-角色分组】
    Route::get('auth/group/page', 'AuthGroup/getPage');
    Route::get('auth/group/info', 'AuthGroup/getInfo');
    Route::get('auth/group/all', 'AuthGroup/getAll');
    Route::post('auth/group/save', 'AuthGroup/onSave');
    Route::post('auth/group/delete', 'AuthGroup/onDelete');
    Route::post('auth/group/status', 'AuthGroup/onStatus');

    //【权限-用户管理】
    Route::get('auth/user/page', 'AuthUser/getPage');
    Route::get('auth/user/info', 'AuthUser/getInfo');
    Route::post('auth/user/save', 'AuthUser/onSave');
    Route::post('auth/user/delete', 'AuthUser/onDelete');
    Route::post('auth/user/status', 'AuthUser/onStatus');
    Route::post('auth/user/delcache', 'AuthUser/onDelCache');

    //【回收站】
    Route::get('recycle/page', 'SysRecycle/getPage');
    Route::post('recycle/back', 'SysRecycle/onBack');
    Route::post('recycle/del', 'SysRecycle/onDel');

})->prefix('store.')->middleware(['token', 'auth']);
